package com.emm.yixun.common.model.enums;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;

public enum GuanZhuEnum implements Serializable{
	DILI("1","地理位置",null),
	KAIFA("2","开发商品牌",null),
	SHENGTAI("3","生态环境",null),
	SHENGZHI("4","升值潜力",null),
	JINGGUAN("5","景观设计",null),
	JIAGE("6","价格因素",null),
	JIAOFU("7","交付时间",null),
	HUISUO("8","会所中心",null),
	WUGUAN("9","物管服务",null),
	HUXING("10","户型设计",null),
	JIAOYU("11","教育资源",null),
	YILIAO("12","医疗资源",null),
	JIENENG("13","节能环保",null),
	ZHUANGXIU("14","装修设计",null),
	SHANGYE("15","商业配套",null),
	RENWEN("16","人文环境",null),
	ZHINENG("17","智能化系统",null),
	JIANZHU("18","建筑风水",null),
	JIANZHUFENGGE("19","建筑风格",null),
	JIANKANG("20","健康服务",null),
	YILE("21","颐乐学院",null),
	QITA("22","其他",null),
	;
	
	private final String no;
	private final String des;
	private final Enum parent;
	
	/**
	 * 私有构造函数
	 * @param code
	 * @param description
	 */
	GuanZhuEnum(String no, String des,Enum parent) {
		this.no = no;
		this.des = des;
		this.parent = parent;
	}

	/**
	 * @return Returns the no.
	 */
	public String getNo() {
		return no;
	}

	/**
	 * @return Returns the des.
	 */
	public String getDes() {
		return des;
	}
	
	/**
	 * @return Returns the parent.
	 */
	public Enum getParent() {
		return parent;
	}

	/**
	 * 通过枚举<code>des</code>获得枚举
	 * 
	 * @param des
	 * @return
	 */
	public static GuanZhuEnum getByDescription(String des) {
		if(StringUtils.isBlank(des)){
			return null;
		}
		for (GuanZhuEnum menum : values()) {
			if (menum.getDes().equals(des)) {
				return menum;
			}
		}
		return null;
	}
	public static GuanZhuEnum getByNo(String no) {
		if(StringUtils.isBlank(no)){
			return null;
		}
		for (GuanZhuEnum menum : values()) {
			if (menum.getNo().equals(no)) {
				return menum;
			}
		}
		return null;
	}
}
